package com.hyzx.qbasic.admin.model.vo.res;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

/**
 * Created by 黄江华 on 2018/4/24
 */

@ApiModel
public class BaseOperationRes<T> {
    @ApiModelProperty("操作是否成功")
    private boolean success;

    //结果数据
    @ApiModelProperty("返回结果数据")
    private T data;

    @ApiModelProperty("操作失败错误信息")
    private String errMsg;

    public BaseOperationRes(boolean success) {
        this(success, StringUtils.EMPTY);
    }

    public BaseOperationRes(boolean success, String errMsg) {
        this(success, errMsg, null);
    }

    public BaseOperationRes(boolean success, String errMsg, T data) {
        this.success = success;
        this.errMsg = errMsg;
        this.data = data;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
